﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Web;

namespace EnCor.Hosting.WSHosting
{
    public class ServiceIndexHttpHandler : IHttpHandler
    {
        WebServiceMapCollection _Maps;
        public ServiceIndexHttpHandler(WebServiceMapCollection maps)
        {
            _Maps = maps;
        }

        #region IHttpHandler Members

        public bool IsReusable
        {
            get { return true; }
        }

        public void ProcessRequest(HttpContext context)
        {
            context.Response.Write("Hello!");
            foreach (WebServiceMapItem item in _Maps)
            {
                context.Response.Write(string.Format("<div><a href='{1}'>{0}</a></div>", item.SoapAction, item.SoapAction));
            }
            //context.Response.End();
        }

        #endregion
    }
}
